#include <stdio.h>
#define N 100
void CharRemove(char str[],char ch)
{
    int i,j,temp;
    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]==ch)
        {
            for(j=i;str[j+1]!='\0';j++)
            {
                temp=str[j];
                str[j]=str[j+1];
                str[j+1]=temp;
            }
            str[j]='\0';
            i--;
        }
    }
}
void main()
{
    char str[N];
    char ch;
    printf("please input a string:\n");
    gets(str);
    printf("please input which character you want to remove:");
    ch=getchar();
    CharRemove(str,ch);
    printf("the result of the string after removing:\n");
    puts(str);
}
